/*
 * Galaxium Messenger
 * 
 * Copyright (C) 2008 Paul Burton <paulburton89@gmail.com>
 * 
 * License: GNU General Public License (GPL)
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

using System;
using System.Runtime.InteropServices;

namespace LibMimic
{
	public enum MimicResEnum : int { Low = 1, High = 2 }
	
	internal static unsafe class MimicInterop
	{
		//MimCtx * 	mimic_open ()
		[DllImport ("libmimic")]
		public static extern IntPtr mimic_open ();
		
		//void 	mimic_close (MimCtx *ctx)
		[DllImport ("libmimic")]
		public static extern void mimic_close (IntPtr context);
		
		//gboolean 	mimic_encoder_init (MimCtx *ctx, const MimicResEnum resolution)
		[DllImport ("libmimic")]
		public static extern bool mimic_encoder_init (IntPtr context, MimicResEnum resolution);
		
		//gboolean 	mimic_decoder_init (MimCtx *ctx, const guchar *frame_buffer)
		[DllImport ("libmimic")]
		public static extern bool mimic_decoder_init (IntPtr context, byte[] buffer);
		
		//gboolean 	mimic_get_property (MimCtx *ctx, const gchar *name, gpointer data)
		[DllImport ("libmimic")]
		public static extern bool mimic_get_property (IntPtr context, string name, void *data);
		
		//gboolean 	mimic_set_property (MimCtx *ctx, const gchar *name, gpointer data)
		[DllImport ("libmimic")]
		public static extern bool mimic_set_property (IntPtr context, string name, void *data);
		
		//gboolean 	mimic_encode_frame (MimCtx *ctx, const guchar *input_buffer, guchar *output_buffer, gint *output_length, gboolean make_keyframe)
		[DllImport ("libmimic")]
		public static extern bool mimic_encode_frame (IntPtr context, byte *input, byte *output, int *outlength, bool makeKeyframe);
		
		//gboolean 	mimic_decode_frame (MimCtx *ctx, const guchar *input_buffer, guchar *output_buffer)
		[DllImport ("libmimic")]
		public static extern bool mimic_decode_frame (IntPtr context, byte *input, byte *output);
	}
}
